﻿/*
    This file is part of News Worm.

    News Worm is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    News Worm is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with News Worm.  If not, see <http://www.gnu.org/licenses/>.
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NewsWorm {
    internal class ScriptParser {
        internal static string ParseScriptDescription( string script ) {
            string retval = "";
            try {
                int i = script.IndexOf( "DESC", 0, StringComparison.CurrentCulture );
                string sub = script.Substring( i );
                int i2 = sub.IndexOf( ";", 0 );
                string sub2 = sub.Substring( 0, i2 );
                retval = sub2.Split( '=' )[1];
                retval = retval.Replace( "\"", "" );
            } catch ( Exception e ) {
                Console.WriteLine( e.Message );
            }

            return retval.Trim();
        }

        internal static string GetIsActiveStatus(string script) {
            return "";
        }
    }
}
